/**
 * Title:       StringMessage.java
 * Copyright:   Copyright (c) 1996-2004 The Agent Factory Working Group. All rights reserved.
 * Licence:     This file is free software; you can redistribute it and/or modify
 *              it under the terms of the GNU Lesser General Public License as published by
 *              the Free Software Foundation; either version 2.1, or (at your option)
 *              any later version.
 *
 *              This file is distributed in the hope that it will be useful,
 *              but WITHOUT ANY WARRANTY; without even the implied warranty of
 *              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *              GNU Lesser General Public License for more details.
 *
 *              You should have received a copy of the GNU Lesser General Public License
 *              along with Agent Factory; see the file COPYING.  If not, write to
 *              the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 *              Boston, MA 02111-1307, USA.
 */
package org.xtext.runtime.messaging;

import java.util.LinkedList;
import java.util.List;

import org.xtext.runtime.formula.Predicate;

/**
 * Implementation of FIPA ACL Messaging Representation in String.
 * 
 * @author Rem Collier
 */
public class AstraMessage {
    String performative;
    String sender;
    List<String> receivers;
    Predicate content;

    String protocol;
    String ontology;
    String language = "astra"; // default value
    String replyWith;
    String inReplyTo;
    String replyBy;
    String replyTo;
    String conversationId;

    /** Creates a new instance of StringMessage */
    public AstraMessage() {
        receivers = new LinkedList<String>();
    }

    public static AstraMessage newInstance() {
        return new AstraMessage();
    }

    public String getAclRepresentation() {
        return "fipa.acl.rep.string.std";
    }

    public String getPayloadEncoding() {
        return "US-ASCII";
    }

    public void setPerformative( String performative ) {
        this.performative = performative;
    }

    public String performative() {
        return performative;
    }

    public void setSender( String sender ) {
        this.sender = sender;
    }

    public String sender() {
        return sender;
    }

    public List<String> getReceivers() {
        return receivers;
    }

    public void setContent( Predicate content ) {
        this.content = content;
    }

    public Predicate content() {
        return content;
    }

    public void setReplyTo( String replyTo ) {
        this.replyTo = replyTo;
    }

    public String getReplyTo() {
        return replyTo;
    }

    public void setReplyWith( String replyWith ) {
        this.replyWith = replyWith;
    }

    public String getReplyWith() {
        return replyWith;
    }

    public void setReplyBy( String replyBy ) {
        this.replyBy = replyBy;
    }

    public String getReplyBy() {
        return replyBy;
    }

    public void setInReplyTo( String inReplyTo ) {
        this.inReplyTo = inReplyTo;
    }

    public String getInReplyTo() {
        return inReplyTo;
    }

    public void setLanguage( String language ) {
        this.language = language;
    }

    public String getLanguage() {
        return language;
    }

    public void setOntology( String ontology ) {
        this.ontology = ontology;
    }

    public String getOntology() {
        return ontology;
    }

    public void setProtocol( String protocol ) {
        this.protocol = protocol;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setConversationId( String conversationId ) {
        this.conversationId = conversationId;
    }

    public String getConversationId() {
        return conversationId;
    }
    
    public void addReceiver( String receiver ) {
    	this.receivers.add( receiver );
    }

}
